package cn.nange.cmfz.service.impl;

import cn.nange.cmfz.dao.AdminLogDao;
import cn.nange.cmfz.entity.AdminLog;
import cn.nange.cmfz.service.AdminLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class AdminLogServiceImpl implements AdminLogService {

    @Autowired
    private AdminLogDao logAdminDao;

    @Override
    public void add(AdminLog la) {
        logAdminDao.add(la);
    }

    @Override
    public void del(Integer id) {
        logAdminDao.del(id);
    }

    @Override
    public PageInfo<AdminLog> show(int page, int rows) {
        PageHelper.startPage(page, rows);
        PageInfo<AdminLog> pageInfo = new PageInfo<>(logAdminDao.show());
        return pageInfo;
    }
}
